From: Keir Fraser Date: Fri, 9 Oct 2009 07:54:25 +0000 (+0100) Subject: Fix the IA64 build of the hypervisor. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13243 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=537f073c371f7f386ce2bc2afb52f19e5f5eac35;p=xen.git Fix the IA64 build of the hypervisor. This is completely untested, beyond confirming that it compiles. Signed-off-by: Steven Smith --- diff --git a/xen/arch/ia64/xen/mm.c b/xen/arch/ia64/xen/mm.c index 437ddbca6e..d2031dc10e 100644 --- a/xen/arch/ia64/xen/mm.c +++ b/xen/arch/ia64/xen/mm.c @@ -3335,7 +3335,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg) gnttab_grow_table(d, xatp.idx + 1); if (xatp.idx < nr_grant_frames(d->grant_table)) - mfn = virt_to_mfn(d->grant_table->shared[xatp.idx]); + mfn = virt_to_mfn(d->grant_table->shared_raw[xatp.idx]); spin_unlock(&d->grant_table->lock); break; diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index db30aa03ce..1deac08473 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1754,7 +1754,7 @@ __acquire_grant_for_copy( blocks mappings of transitive grants. */ is_sub_page = 1; *owning_domain = rrd; - act->gfn = INVALID_GFN; + act->gfn = -1ul; } else if ( sha1 ) { diff --git a/xen/include/asm-ia64/grant_table.h b/xen/include/asm-ia64/grant_table.h index 58aa635f46..c540be36c5 100644 --- a/xen/include/asm-ia64/grant_table.h +++ b/xen/include/asm-ia64/grant_table.h @@ -31,8 +31,12 @@ int guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long m /* Guest physical address of the grant table. */ #define IA64_GRANT_TABLE_PADDR IA64_XMAPPEDREGS_PADDR(NR_CPUS) -#define gnttab_shared_maddr(t, i) (virt_to_maddr((t)->shared[(i)])) -#define gnttab_shared_page(t, i) (virt_to_page((t)->shared[(i)])) +#define gnttab_shared_maddr(t, i) (virt_to_maddr((t)->shared_raw[(i)])) +#define gnttab_shared_page(t, i) (virt_to_page((t)->shared_raw[(i)])) + +#define gnttab_status_maddr(t, i) (virt_to_maddr((t)->status[(i)])) +#define gnttab_status_mfn(t, i) (virt_to_maddr((t)->status[(i)]) >> PAGE_SHIFT) +#define gnttab_status_page(t, i) (virt_to_page((t)->status[(i)])) #define ia64_gnttab_create_shared_page(d, t, i) \ do { \ @@ -55,8 +59,26 @@ int guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long m ia64_gnttab_create_shared_page((d), (t), (i)); \ } while (0) +#define ia64_gnttab_create_status_page(d, t, i) \ + do { \ + BUG_ON((d)->arch.mm.pgd == NULL); \ + assign_domain_page((d), \ + IA64_GRANT_TABLE_PADDR + ((i) << PAGE_SHIFT), \ + gnttab_status_maddr((t), (i))); \ + } while (0) + +#define gnttab_create_status_page(d, t, i) \ + do { \ + share_xen_page_with_guest(gnttab_status_page((t), (i)), \ + (d), XENSHARE_writable); \ + if ((d)->arch.mm.pgd) \ + ia64_gnttab_create_status_page((d), (t), (i)); \ + } while (0) + #define gnttab_shared_gmfn(d, t, i) \ ((IA64_GRANT_TABLE_PADDR >> PAGE_SHIFT) + (i)) +#define gnttab_status_gmfn(d, t, i) \ + (mfn_to_gmfn(d, gnttab_status_mfn(t, i))) #define gnttab_mark_dirty(d, f) ((void)f) diff --git a/xen/include/asm-x86/grant_table.h b/xen/include/asm-x86/grant_table.h index 07e96b661b..f435fa08c9 100644 --- a/xen/include/asm-x86/grant_table.h +++ b/xen/include/asm-x86/grant_table.h @@ -44,7 +44,7 @@ int replace_grant_host_mapping( ((virt_to_maddr((t)->status[i]) >> PAGE_SHIFT)) #define gnttab_status_gmfn(d, t, i) \ - (mfn_to_gmfn(d, gnttab_status_mfn(d, t, i))) + (mfn_to_gmfn(d, gnttab_status_mfn(t, i))) #define gnttab_mark_dirty(d, f) paging_mark_dirty((d), (f))